[= AutoGen5 template texi

##  Documentation template
##
## Time-stamp:        "2008-09-13 10:31:35 bkorb"
## Author:            Bruce Korb <bkorb@gnu.org>
##
##  This file is part of AutoOpts, a companion to AutoGen.
##  AutoOpts is free software.
##  AutoOpts is copyright (c) 1992-2007 by Bruce Korb - all rights reserved
##
##  AutoOpts is available under any one of two licenses.  The license
##  in use must be one of these two and the choice is under the control
##  of the user of the license.
##
##   The GNU Lesser General Public License, version 3 or later
##      See the files "COPYING.lgplv3" and "COPYING.gplv3"
##
##   The Modified Berkeley Software Distribution License
##      See the file "COPYING.mbsd"
##
##  These files have the following md5sums:
##
##  239588c55c22c60ffe159946a760a33e pkg/libopts/COPYING.gplv3
##  fa82ca978890795162346e661b47161a pkg/libopts/COPYING.lgplv3
##  66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd
##
## ---------------------------------------------------------------------
## $Id: aginfo.tpl,v 4.5 2008/04/14 15:33:43 bkorb Exp $
## ---------------------------------------------------------------------

(setenv "SHELL" "/bin/sh")

=] \input texinfo   @c -*-texinfo-*-
@c %**start of header[= 
	(define  down-prog-name ( string-downcase (get "prog-name")))
	(define downcase-prg-name ( string-downcase (get "prog-name")))=][=
 
	(define file-name         (string-append downcase-prg-name ".info"))

=]
@setfilename [= 

	(. file-name)

 =][=

	(define downcase-prog-title (string-downcase (get "prog-title")))

=]
@settitle [=

	prog-title 

=]
@c %**end of header

[=

	IF(exist? "texi-set-chapter-new-page") 

=][=

		CASE texi-set-chapter-new-page 

=][=
			= off
=]@setchapternewpage off[=
			= odd 
=]@setchapternewpage odd[=
			= on 
=]@setchapternewpage on[=

  		ESAC

=][=
	ENDIF
=]
@titlepage
@sp 10
@comment The title is printed in a large font.
@center @titlefont{Sample Title}

@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
@ignore
[=

(dne "# " "# ")

=]
@end ignore
@copyright{} 1990 Free Software Foundation, Inc.
[= IF (exist? "copyright") =]

This software is released under [=

  CASE copyright.type 
=][=

   =  gpl 
=]the GNU General Public License[=

   = lgpl 
=]the GNU General Public License with Library Extensions[=

   =  bsd 

=]the Free BSD License[=

   *      
=]a specialized copyright license[=

  ESAC =].[=

ENDIF 

=]
@end titlepage

@node [= prog-name =] Invocation
@[=
 
 	(define doc-level (getenv "LEVEL"))

 	(define coded-prog-name (string-append "@code{"downcase-prg-name"}"))

 	(define replace-prog-name (lambda (nm)
   		(string-substitute (get nm)
     			"ntpq"
    		 coded-prog-name )  ))

 	(if (not (string? doc-level))
     		(set! doc-level "unnumberedsec"))

 	doc-level =] Invoking [= prog_name =]


@pindex [=
	
	prog-name  

=]
@cindex [= 

	prog-title 

=][=

	FOR concept 

=]
@cindex [= concept =][=
ENDFOR

=]
[=
	IF (exist? "prog-info-descrip")  =][=
  		FOR prog-info-descrip  "\n\n"  =][=
    		prog-info-descrip            =][=
  	ENDFOR                         =][=
		ELIF (exist? "detail")           =][=
  	(replace-prog-name "detail")   =][=
	ENDIF
=]
@menu
* [=

	(sprintf "%s %-24s %s"down-prog-name "detais::"(get "prog-name"))

=]detais of ntpq command 
* [=

	(sprintf "%s %-24s %s"down-prog-name "usage::"(get "prog-name"))

=]usage help[=

     (if (exist? "flag.value") " (-?)") 

=]
[=

	(out-push-new (string-append (out-name) ".tmp"))

  	(shell (string-append "f=" (out-name))) 
=][=

FOR flag 

=][=

	IF (not (exist? "documentation"))

=]* [=
	(sprintf "%s %-24s"
         	(. down-prog-name)
         	(string-append(string-tr! (get "name") "A-Z^_" "a-z--" ) "::" ) )

=][=
	
	% name (string-tr! "%s" "A-Z^_" "a-z--")=] option[=

          % value " (-%s)" 

=]
[=

	ENDIF

=][=

	ENDFOR flag

=][=

	(out-pop) 

=][=

	`sort $f ; rm -f $f` 

=]
@end menu
[= ?% explain %s "This program has no explanation.\n" =]


@node [= (sprintf "%s %-24s" down-prog-name "detais") =] 
@[= CASE (. doc-level) =][=
	= unnumbered    =][=
	= unnumberedsec =]unnumberedsubsec[=
	= unnumberedsubsec =]unnumberedsubsubsec[=
	ESAC =] [= down-prog-name =] Details
@cindex [= prog-name =] Details


@node [= (sprintf "%s %-24s" down-prog-name "usage") =] 
@[= CASE (. doc-level) =][=
	= unnumbered    =][=
	= unnumberedsec =]unnumberedsubsec[=
	= unnumberedsubsec =]unnumberedsubsubsec[=
	ESAC =] [= prog-name =] Usage 
@cindex [= (. down-prog-name) =] Usage



[=
IF (define opt-name "")
   (define extra-ct 0)
   (define extra-text "")
   (exist? "preserve-case")     =][=
   (define optname-from "_^")
   (define optname-to   "--")   =][=
ELSE                            =][=
  (define optname-from "A-Z")
  (define optname-to   "a-z") =][=
ENDIF                           =][=

FOR flag=][=

  IF (not (exist? "documentation")) =]

@node [=
    (set! opt-name (string-tr (get "name") optname-from optname-to))
    (string-append down-prog-name " " opt-name)=]
@[=CASE (. doc-level) =][=
   = unnumbered    =][=
   = unnumberedsec    =]unnumberedsubsec [=
   = unnumberedsubsec =]unnumberedsubsubsec [=
   ESAC =][=(. opt-name)=] option[=
          % value " (-%s)" =]
@cindex [=(. down-prog-name)=]-[= (. opt-name) =]
This is the ``[=(string-downcase! (get "descrip"))=]'' option.
[= ?% doc "\n%s" "\nThis option has no @samp{doc} documentation." =]
[=ENDIF=]
[=ENDFOR=]
[= (. opt-name) =]
[= (set! extra-ct (+ extra-ct 1)) =]
[= (. extra-ct) =]
[= flag.test =]
[= FOR flag (for-from 1) (for-to 3) =]
[= flag.name =]
[= ENDFOR=]
[= prog-detail =]
